package com.chinacoal.microservice.controller;

import com.chinacoal.microservice.MessageManagementClient;
import com.chinacoal.microservice.pojo.CcmsSmartleasingMessage;
import com.chinacoal.microservice.service.MessageManagementService;
import com.chinacoal.microservice.util.QueryCriteria;
import com.chinacoal.microservice.util.Result;
import com.chinacoal.microservice.util.UserLoginToken;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zhuliang
 * @version V1.0
 * @Description: 运维管理-消息管理-后端控制类
 * @date 2020-12-31 16：42
 */
@RestController
public class MessageManagementController implements MessageManagementClient {

    @Autowired
    private MessageManagementService messageManagementService;

    /**
     * @Description: 查询所有的消息信息（带分页）
     * @author zhuliang
     * @date 2020/12/31 16:49
     */
    @Override
    @UserLoginToken
    public Result<List<CcmsSmartleasingMessage>> getAllByPage(QueryCriteria queryCriteria, String token) {
        return messageManagementService.getAllByPage(queryCriteria, token);
    }

    /**
     * @Description: 条件查询所有的消息信息（带分页）
     * @author zhuliang
     * @date 2020/12/31 16:49
     */
    @Override
    @UserLoginToken
    public Result<List<CcmsSmartleasingMessage>> getAllByCondition(QueryCriteria queryCriteria, String token) {
        return messageManagementService.getAllByCondition(queryCriteria, token);
    }
}
